#include "public.h"

vector<string> v_files;
void showFiles(){
    string filePaths = "E:\\tdx_export\\20220206_hdf_final";
    v_files = getFiles(filePaths);
    printl(RED,v_files.size(),"\n");
    filePaths="C:\\Users\\kaifamiao\\CLionProjects\\read_tdx\\";
    v_files = getFiles(filePaths,"*.day");
    printl(RED,v_files.size(),"\n");

    v_files = getAllFiles("E:\\tdx_export\\20220206_hdf_final");
    cout << v_files.size()<<endl;
//    for_each(v_files.begin(), v_files.end(), [](int val)->void {  cout << val << endl;});
    // 第二种方式遍历
//    for (vector<string> ::iterator start = v_files.begin(); start != v_files.end(); start++)
//    {
//        cout << *start << ",";
//    }

    /// -- 使用for_each内置算法进行遍历  配合匿名函数    需要包含头文件#include<algorithm>
    for_each(v_files.begin(), v_files.end(), [](string val)->void {  cout << val << endl;});

}
int show(int a,int b){
    showFiles();
    return (a+b)*2;
}
int main() {

    printl(GREEN,"program is running....","\n");
    exec(show,8,8);
    printl(GREEN,"program is ending....","\n");
    return 0;
}
